<%@page contentType="text/html" pageEncoding="windows-1252"%>
<%@page import="java.sql.SQLException"%>
<%@page import="startup.model.user.Professor"%>
<%
	try
	{
		Professor professor = ( Professor )session.getAttribute( "currentSessionUser" );

		professor.showRoles( professor.getId() );
		professor.nameOfAdmin();
%>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="windows-1252">
		<title>Coordinator</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="description" content="">
		<meta name="author" content="">
		<!-- Le styles -->
		<link href="styles/bootstrap.css" rel="stylesheet">
		<style type="text/css">
			body {
				padding-top: 60px;
				padding-bottom: 40px;
			}
			.sidebar-nav {
				padding: 9px 0;
			}
		</style>
	</head>
	<body>
        <!--Barra Superiore-->
        <div class="navbar navbar-fixed-top">
			<div class="navbar-inner">
				<div class="container-fluid">
					<a class="brand" href="#">Professor : <%= professor.getSurname() %> <%= professor.getName() %></a>
					<div class="nav pull-right">
						<ul class="nav">
							<li>
								<form action="Logout" method="post">
									<button class="btn btn-primary btn-small">Sign out</button>
								</form>
							</li>
						</ul>
					</div>
				</div>
			</div>
        </div>
        <!--CONTENUTO LISTE -->
        <div class="container-fluid">
            <div class="row-fluid">
                <div class="span3" style="position:fixed;">
                    <div class="well sidebar-nav">
                        <ul class="nav nav-list"> 
                            <li class="nav-header">Location</li>
                            <li class="active"><a href="professorHome.jsp"><i class="icon-white icon-home"></i> Home</a></li>
                            <li class="nav-header">Roles</li>
                            <%
								if( professor.isCoordinator() == true )
								{
                            %>
                            <li><a href="coordinatorShowTrips.jsp"><i class="icon-user"></i> Coordinator</a></li>
                            <%								}
								if( professor.isManager() == true )
								{
                            %>
                            <li><a href="managerShowTrips.jsp"><i class="icon-user"></i> Manager</a></li>
                            <%								}
								if( professor.isSupervisor() == true )
								{
                            %>
                            <li><a href="supervisorShowTrips.jsp"><i class="icon-user"></i> Supervisor</a></li>
                            <%								}
                            %>
                            <li class="nav-header">Function</li>
                            <li><a href="professorFAQ.jsp"><i class="icon-info-sign"></i> F.A.Q.</a></li>
                        </ul>
                    </div><!--/.well -->
                </div><!--/span-->
                <div class="span9" style="margin-left: 26%;">
                    <div class="hero-unit">
                        <h1>Home</h1>
                        <br />
						<table>
							<tr>
								<td rowspan="2" width="150" height="200">
									<img class="pagination-centered" src="http://placehold.it/130x180">
								</td>
								<td width="510" height="50" style="padding-top:8px;">
									<h2> <%=professor.getSurname()%> <%=professor.getName()%></h2>
									<h6><small>Professor's id : </small><%=professor.getId()%></h6>
								</td>
							</tr>
						</table>
                    </div>
                </div>
            </div>
        </div><!--/.fluid-container-->
        <div class="navbarCC navbar-fixed-bottom">
            <div class="navbarCC-inner">
                <div class="container-fluid">				
                    <a class="brand" href="#">&copy; 2012 Startup</a>					
                </div>
            </div>
        </div>
		<!-- Il javascript -->
		<script src="js/jquery.js"></script>
		<script src="js/bootstrap.js"></script>
	</body>
</html>
<%
	}
	catch( SQLException sqlException )
	{
		sqlException = new SQLException( "The database is currently busy.<br />" +
										 "If the problem persists, please report it to the administration." );
		request.setAttribute( "exception", sqlException );
		request.getRequestDispatcher( "errorPage.jsp" ).forward( request, response );
	}
	catch( RuntimeException runtimeException )
	{
		if( runtimeException.getClass().equals( NullPointerException.class ) )
		{
			runtimeException = new NullPointerException( "The session has timed out:<br />" + "" +
														 "try reloading page.<br />" +
														 "If the problem persists, please report it to the administration." );
		}
		request.setAttribute( "exception", runtimeException );
		request.getRequestDispatcher( "errorPage.jsp" ).forward( request, response );
	}
%>